﻿using System;
using System.Collections.Generic;
using System.IO;
using Orchard.ContentManagement;
using Orchard.Tasks;
using Orchard.Workflows.Services;

namespace Amba.Workflow.Tasks
{
    public class PeriodicalTask : IBackgroundTask
    {
        private readonly IWorkflowManager _workflowManager;

        public PeriodicalTask(IWorkflowManager workflowManager, IContentManager contentManager)
        {
            _workflowManager = workflowManager;
        }

        public void Sweep()
        {
            var contentItem  = new ContentItem();
            _workflowManager.TriggerEvent("PeriodicalEvent", contentItem, () => new Dictionary<string, object> { { "Content", contentItem } });
        }
    }
}